﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Examination.Args
{
    /// <summary>
    /// 响应数据
    /// </summary>
    public class ResponseData
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public int Status { get; set; } = 0;

        /// <summary>
        /// 消息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public object Data { get; set; }

        /// <summary>
        /// 身份验证失败
        /// </summary>
        /// <returns></returns>
        public static ResponseData ValidationFailed()
        {
            return new ResponseData()
            {
                Status = -1,
                Msg = "登录过期，请重新登录！"
            };
        }

        /// <summary>
        /// 没有权限
        /// </summary>
        /// <returns></returns>
        public static ResponseData NoPermission()
        {
            return new ResponseData()
            {
                Status = 1,
                Msg = "没有权限"
            };
        }
    }
}
